home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / appkit / Cell.h < prev    next >
Text File  |  1992-09-11  |  7KB  |  251 lines

  1. /*
  2.     Cell.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <objc/Object.h>
  8. #import "graphics.h"
  9.  
  10. /* Cell Data Types */
  11.  
  12. #define NX_ANYTYPE 0
  13. #define NX_INTTYPE 1
  14. #define NX_POSINTTYPE 2
  15. #define NX_FLOATTYPE 3
  16. #define NX_POSFLOATTYPE 4
  17. #define NX_DATETYPE 5
  18. #define NX_DOUBLETYPE 6
  19. #define NX_POSDOUBLETYPE 7
  20.  
  21. /* Cell Types */
  22.  
  23. #define NX_NULLCELL    0
  24. #define    NX_TEXTCELL    1
  25. #define NX_ICONCELL    2
  26.  
  27. /* Cell & ButtonCell */
  28.  
  29. #define NX_CELLDISABLED        0
  30. #define    NX_CELLSTATE        1
  31. #define    NX_CELLEDITABLE        3
  32. #define    NX_CELLHIGHLIGHTED    5
  33. #define NX_LIGHTBYCONTENTS    6
  34. #define NX_LIGHTBYGRAY        7
  35. #define NX_LIGHTBYBACKGROUND    9
  36. #define NX_ICONISKEYEQUIVALENT    10
  37. #define NX_HASALPHA        11
  38. #define NX_BORDERED        12
  39. #define NX_OVERLAPPINGICON    13
  40. #define NX_ICONHORIZONTAL    14
  41. #define NX_ICONONLEFTORBOTTOM    15
  42. #define    NX_CHANGECONTENTS    16
  43. #define    NX_BUTTONINSET        17
  44.  
  45. /* ButtonCell icon positions */
  46.  
  47. #define NX_TITLEONLY        0
  48. #define NX_ICONONLY        1
  49. #define NX_ICONLEFT        2
  50. #define NX_ICONRIGHT        3
  51. #define NX_ICONBELOW        4
  52. #define NX_ICONABOVE        5
  53. #define NX_ICONOVERLAPS        6
  54.  
  55. /* ButtonCell highlightsBy and showsStateBy mask */
  56.  
  57. #define NX_NONE            0
  58. #define NX_CONTENTS        1
  59. #define NX_PUSHIN        2
  60. #define NX_CHANGEGRAY        4
  61. #define NX_CHANGEBACKGROUND    8
  62.  
  63. /* Cell whenActionIsSent mask flag */
  64.  
  65. #define NX_PERIODICMASK (1 << (NX_LASTEVENT+1))
  66.  
  67. @interface Cell : Object
  68. {
  69.     char               *contents;
  70.     id                  support;
  71.     struct _cFlags1 {
  72. #ifdef __BIG_ENDIAN__
  73.     unsigned int        state:1;
  74.     unsigned int        highlighted:1;
  75.     unsigned int        disabled:1;
  76.     unsigned int        editable:1;
  77.     unsigned int        type:2;
  78.     unsigned int        freeText:1;
  79.     unsigned int        alignment:2;
  80.     unsigned int        bordered:1;
  81.     unsigned int        bezeled:1;
  82.     unsigned int        selectable:1;
  83.     unsigned int        scrollable:1;
  84.     unsigned int        entryType:3;
  85. #else
  86.     unsigned int        entryType:3;
  87.     unsigned int        scrollable:1;
  88.     unsigned int        selectable:1;
  89.     unsigned int        bezeled:1;
  90.     unsigned int        bordered:1;
  91.     unsigned int        alignment:2;
  92.     unsigned int        freeText:1;
  93.     unsigned int        type:2;
  94.     unsigned int        editable:1;
  95.     unsigned int        disabled:1;
  96.     unsigned int        highlighted:1;
  97.     unsigned int        state:1;
  98. #endif
  99.     }                   cFlags1;
  100.     struct _cFlags2 {
  101. #ifdef __BIG_ENDIAN__
  102.     unsigned int        continuous:1;
  103.     unsigned int        actOnMouseDown:1;
  104.     unsigned int        _isLeaf:1;
  105.     unsigned int        floatLeft:4;
  106.     unsigned int        floatRight:4;
  107.     unsigned int        autoRange:1;
  108.     unsigned int        actOnMouseDragged:1;
  109.     unsigned int        _isLoaded:1;
  110.     unsigned int        noWrap:1;
  111.     unsigned int        dontActOnMouseUp:1;
  112. #else
  113.     unsigned int        dontActOnMouseUp:1;
  114.     unsigned int        noWrap:1;
  115.     unsigned int        _isLoaded:1;
  116.     unsigned int        actOnMouseDragged:1;
  117.     unsigned int        autoRange:1;
  118.     unsigned int        floatRight:4;
  119.     unsigned int        floatLeft:4;
  120.     unsigned int        _isLeaf:1;
  121.     unsigned int        actOnMouseDown:1;
  122.     unsigned int        continuous:1;
  123. #endif
  124.     }                   cFlags2;
  125.     struct __cFlags3 {
  126.     unsigned int        isWhite:1;
  127.     unsigned int        useUserKeyEquivalent:1;
  128.     unsigned int        center:1;
  129.     unsigned int        docEditing:1;
  130.     unsigned int        docSaved:1;
  131.     unsigned int        wasSelectable:1;
  132. #ifdef KANJI
  133.     unsigned int        dontUseInputManager:1;
  134.     unsigned int        RESERVED:9;
  135. #else
  136.     unsigned int        RESERVED:10;
  137. #endif
  138.     }            _cFlags3;
  139.     unsigned short        _reservedCshort;
  140. }
  141.  
  142.  
  143. + (BOOL)prefersTrackingUntilMouseUp;
  144.  
  145. - init;
  146. - initTextCell:(const char *)aString;
  147. - initIconCell:(const char *)iconName;
  148.  
  149. - copyFromZone:(NXZone *)zone;
  150. - awake;
  151. - free;
  152. - controlView;
  153. - (int)type;
  154. - setType:(int)aType;
  155. - (int)state;
  156. - setState:(int)value;
  157. - incrementState;
  158. - target;
  159. - setTarget:anObject;
  160. - (SEL)action;
  161. - setAction:(SEL)aSelector;
  162. - (int)tag;
  163. - setTag:(int)anInt;
  164. - (BOOL)isOpaque;
  165. - (BOOL)isEnabled;
  166. - setEnabled:(BOOL)flag;
  167. - (int)sendActionOn:(int)mask;
  168. - (BOOL)isContinuous;
  169. - setContinuous:(BOOL)flag;
  170. - (BOOL)isEditable;
  171. - setEditable:(BOOL)flag;
  172. - (BOOL)isSelectable;
  173. - setSelectable:(BOOL)flag;
  174. - (BOOL)isBordered;
  175. - setBordered:(BOOL)flag;
  176. - (BOOL)isBezeled;
  177. - setBezeled:(BOOL)flag;
  178. - (BOOL)isScrollable;
  179. - setScrollable:(BOOL)flag;
  180. - (BOOL)isHighlighted;
  181. - (int)alignment;
  182. - setAlignment:(int)mode;
  183. - setWrap:(BOOL)flag;
  184. - font;
  185. - setFont:fontObj;
  186. - (int)entryType;
  187. - setEntryType:(int)aType;
  188. - (BOOL)isEntryAcceptable:(const char *)aString;
  189. - setFloatingPointFormat:(BOOL)autoRange left:(unsigned)leftDigits right:(unsigned)rightDigits;
  190. - (unsigned short)keyEquivalent;
  191. - (const char *)stringValue;
  192. - setStringValue:(const char *)aString;
  193. - setStringValueNoCopy:(const char *)aString;
  194. - setStringValueNoCopy:(char *)aString shouldFree:(BOOL)flag;
  195. - (int)intValue;
  196. - setIntValue:(int)anInt;
  197. - (float)floatValue;
  198. - setFloatValue:(float)aFloat;
  199. - (double)doubleValue;
  200. - setDoubleValue:(double)aDouble;
  201. - takeIntValueFrom:sender;
  202. - takeFloatValueFrom:sender;
  203. - takeDoubleValueFrom:sender;
  204. - takeStringValueFrom:sender;
  205. - (const char *)icon;
  206. - setIcon:(const char *)iconName;
  207. - (int)getParameter:(int)aParameter;
  208. - setParameter:(int)aParameter to:(int)value;
  209. - getIconRect:(NXRect *)theRect;
  210. - getTitleRect:(NXRect *)theRect;
  211. - getDrawRect:(NXRect *)theRect;
  212. - calcCellSize:(NXSize *)theSize;
  213. - calcCellSize:(NXSize *)theSize inRect:(const NXRect *)aRect;
  214. - calcDrawInfo:(const NXRect *)aRect;
  215. - setTextAttributes:textObj;
  216. - drawInside:(const NXRect *)cellFrame inView:controlView;
  217. - drawSelf:(const NXRect *)cellFrame inView:controlView;
  218. - highlight:(const NXRect *)cellFrame inView:controlView lit:(BOOL)flag;
  219. - (int)mouseDownFlags;
  220. - getPeriodicDelay:(float*)delay andInterval:(float*)interval;
  221. - (BOOL)startTrackingAt:(const NXPoint *)startPoint inView:controlView;
  222. - (BOOL)continueTracking:(const NXPoint *)lastPoint at:(const NXPoint *)currentPoint inView:controlView;
  223. - stopTracking:(const NXPoint *)lastPoint at:(const NXPoint *)stopPoint inView:controlView mouseIsUp:(BOOL)flag;
  224. - (BOOL)trackMouse:(NXEvent *)theEvent inRect:(const NXRect *)cellFrame ofView:controlView;
  225. - edit:(const NXRect *)aRect inView:controlView editor:textObj delegate:anObject event:(NXEvent *)theEvent;
  226. - select:(const NXRect *)aRect inView:controlView editor:textObj delegate:anObject start:(int)selStart length:(int)selLength;
  227. - endEditing:textObj;
  228. - write:(NXTypedStream *)stream;
  229. - read:(NXTypedStream *)stream;
  230. - resetCursorRect:(const NXRect *)cellFrame inView:controlView;
  231.  
  232. /* 
  233.  * The following new... methods are now obsolete.  They remain in this  
  234.  * interface file for backward compatibility only.  Use Object's alloc method  
  235.  * and the init... methods defined in this class instead.
  236.  */
  237. + new;
  238. + newTextCell;
  239. + newTextCell:(const char *)aString;
  240. + newIconCell;
  241. + newIconCell:(const char *)iconName;
  242.  
  243. @end
  244.  
  245. #ifdef KANJI
  246. @interface Cell(InputManager)
  247. - (BOOL)cellUsesIM;
  248. - setCellUsesIM:(BOOL)flag;
  249. @end
  250. #endif
  251.